// 导入文件
import { _fetch } from '@/utils/request.js'

// 1.1面试技巧列表
export function apiInterviewingList ({ start, limit, q }) {
  return _fetch({
    url: '/articles/technic',
    method: 'GET',
    params: { start: start, limit: limit, q: q }
    // needToken: true
  })
}

// 1.2面试技巧详情接口
export function apiInterviewingParticulars (id) {
  return _fetch({
    url: '/articles/technic/' + id,
    method: 'GET'
  })
}

// 1.3面试技巧热搜接口
export function apiInterviewingSreach () {
  return _fetch({
    url: '/articles/technicTopSearch',
    method: 'GET'
  })
}

// 2.1 热门职位数据
export function apiHotJob () {
  return _fetch({
    url: '/chart-data/hot',
    method: 'GET'
    // needToken: true
  })
}

// 2.2 获取城市
export function apigetCityPost () {
  return _fetch({
    url: '/chart-data/indexes',
    method: 'GET'
  })
}

// 2.3 获取统计信息接口
export function apigetStatistics ({ city, position }) {
  return _fetch({
    url: '/chart-data/statistics',
    method: 'GET',
    params: { city: city, position: position }
  })
}

// 3.1面经分享列表接口
export function apiExperienceList ({ start, limit, q }) {
  return _fetch({
    url: '/articles/share',
    method: 'GET',
    params: { start: start, limit: limit, q: q }
    // needToken: true
  })
}

// 3.2面经详情接口
export function apiExperienceParticulars (id) {
  return _fetch({
    url: '/articles/share/' + id,
    method: 'GET'
  })
}

// 3.2.1 面经详情收藏
export function apiExperienceCollect (id) {
  return _fetch({
    url: '/articles/collect',
    method: 'POST',
    data: { id: id },
    needToken: true
  })
}

// 3.2.2 面经详情点赞
export function apiExperienceStar (id) {
  return _fetch({
    url: '/articles/star',
    method: 'POST',
    data: { article: id },
    needToken: true
  })
}

// 3.3面经分享评论接口
export function apiExperienceComments ({ start, limit, id }) {
  return _fetch({
    url: '/articles/comments/' + id,
    method: 'GET',
    params: { start: start, limit: limit, id: id }
  })
}

// 3.3.1 面经详情评论点赞
export function apiExComStar (id) {
  return _fetch({
    url: '/article-comments/star',
    method: 'POST',
    data: { id: id },
    needToken: true
  })
}

// 3.4面经分享评论及评论回复
export function apiExperienceReply ({ content, article, parent }) {
  return _fetch({
    url: '/articles/comments',
    method: 'POST',
    data: { content: content, article: article, parent: parent },
    needToken: true
  })
}

// 3.6面经热搜接口
export function apiParticularsSreach () {
  return _fetch({
    url: '/articles/shareTopSearch',
    method: 'GET'
  })
}
